.class public Lcom/nbi/common/NBIContext;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/nbi/common/NBIObject;


# static fields
.field public static final API_VERSION:Ljava/lang/String; = "1.5.0"

.field public static final BUILD_VERSION:Ljava/lang/String; = "962"

.field public static final LOCATION_KIT_VERSION:I = 0x1

.field public static final MAP_KIT_VERSION:I = 0x1


# instance fields
.field private ci:Lnbisdk/bl;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Lnbisdk/bl;

    invoke-direct {v0, p1, p2}, Lnbisdk/bl;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    const/4 v0, 0x0

    if-eqz p3, :cond_1

    const-string v1, "en"

    invoke-virtual {p3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    const-string v1, "es"

    invoke-virtual {p3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "-US"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :cond_1
    invoke-static {v0}, Lnbisdk/g;->b(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/Locale;->getCountry()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v1

    if-lez v1, :cond_3

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "-"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Ljava/util/Locale;->getCountry()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    :goto_0
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lnbisdk/g;->b(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_4

    :cond_2
    :goto_1
    iget-object v1, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    invoke-virtual {v1, v0}, Lnbisdk/bl;->v(Ljava/lang/String;)V

    return-void

    :cond_3
    const-string v1, ""

    goto :goto_0

    :cond_4
    const-string v0, "en-US"

    goto :goto_1
.end method


# virtual methods
.method public cleanCache()V
    .locals 0

    invoke-static {}, Lnbisdk/ie;->clear()V

    return-void
.end method

.method public destroy()V
    .locals 1

    iget-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    invoke-virtual {v0}, Lnbisdk/bl;->destroy()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    return-void
.end method

.method public getInternalObject()Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    return-object v0
.end method

.method public getLanguage()Ljava/lang/String;
    .locals 4

    const/4 v3, 0x2

    iget-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    invoke-virtual {v0}, Lnbisdk/bl;->df()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    const/4 v2, 0x5

    if-eq v1, v2, :cond_0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    if-ne v1, v3, :cond_1

    :cond_0
    const/4 v1, 0x0

    invoke-virtual {v0, v1, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public setContextErrorListener(Lcom/nbi/common/NBIContextListener;)V
    .locals 1

    iget-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/nbi/common/NBIContext;->ci:Lnbisdk/bl;

    invoke-virtual {v0, p1}, Lnbisdk/bl;->a(Lcom/nbi/common/NBIContextListener;)V

    :cond_0
    return-void
.end method
